<template name="sendcar">
	<!--摄像头列表 -->
	<view class="mypage">
		<view class="card-list-wrapper">
			<view class="card-list-row radius shadow-warp bg-white margin-top" v-for="(item,index) in planList" :key="index" @click="openDetail(item)">
				
				<view class="flex-just-between bottom-border top-wrap">
					<text class="text-blue text-bold">{{ item.VDEF3 }}</text>
					<view class="cu-capsule radius">
						<view class='cu-tag bg-blue sm'>
							<text class='cuIcon-medal'></text>
						</view>
						<view class="cu-tag line-brown sm">
							{{ index+1}}
						</view>
					</view>
				</view>
				
				<view class="card-list-row-1">
					<text class="cuIcon-title text-red"></text>
					<text class="card-label text-black">监控：</text>
					<text>{{ item.CameraName || '' }}</text>
				</view>
				
				<!-- <view class="card-list-row-1">
					<text class="cuIcon-title text-green"></text>
					<text class="card-label text-black">仓库：</text>
					<text>{{ item.STORENAME || '' }}</text>
				</view>
				<view class="card-list-row-1">
					<text class="cuIcon-title text-blue"></text>
					<text class="card-label text-black">移位人：</text> 
					<text>{{ item.MOVER || '' }}</text>
				</view> -->
						
			</view>
		
		</view>
		
	</view>

</template>

<script>
	import {
		mapState,
		mapMutations
	} from 'vuex'
	import api from '@/common/api.js'
	var testModule = uni.requireNativePlugin("TestModule")
	let _self, page=1, total=1, originalTitle,type;
	let query = {
			"category":"", 
			"page":1,
			"rows":5,
			"sidx":"",
			"sord":"",
			"queryJson":{BTCATEGORY:0,MOVETYPE:0},
			"userId":"",
			"account":"admin"
	}
	export default {
		computed: mapState(['userInfo','baseUrl']),
		data() {
			return {
				title: '列表',
				keyword: '' ,
				planList: [],
				label01: '订单',
				
			};
		},
		onLoad(params) {
		
			this.getNewsList(params.id);
			// console.log(params);
			
		},
		//下拉刷新
		onPullDownRefresh : function(){
			// 重置分页及数据
			page = 1;
			total = 1 ;
			this.getNewsList();
			setTimeout(function() {
				uni.stopPullDownRefresh();
			}, 1000);
			uni.showToast({"title":"数据已刷新", icon:"none"});
		},
		// 加载更多
		onReachBottom : function(){
			this.getNewsList();
		}, 
		onNavigationBarButtonTap() {
			this.openDetail(0)
		},
		methods:{
			
			getNewsList(BillNo){
				let requestData = {
					type: 1,
					zbOrHwBillNo: BillNo
				}
				this.axios({
					url: '/API/APPCommon/GetSysBoadCamera' ,
					data: requestData ,
					isLoading: 1
				}).then(res=>{
					this.planList = res.Result
				}) 
			},
			
			openDetail:function(e){
				this.gotoNativePage(e,'')
			},
			
			gotoNativePage(data, name) {
				testModule.gotoNativePage(
					getApp().globalData.Token,
					getApp().globalData.BaseURL,
					data.VIDEOTYPE || '3', // 查看类型  1 云台， 2轨迹， 3盘点数量
					data.CameraNo || '', // 摄像头IP
					data.LoginName || '', // 摄像头密码账户
					data.PassWord || '', // 摄像头密码
					data.Port || '', // 摄像头端口
					data.Channel || '0', // 摄像头通道号
					data.VDEF4 || '0', // 录像机IP 
					data.VDEF5 || '', // 录像机账户
					data.VDEF6 || '', // 录像机密码
					data.VDEF7 || '0', // 录像端口
					data.VDEF11 || '0', // 录像机通道号
					'',
					'',
					data.PK_BILLNO || '',
					'',
					'',
					name || '',
				);
			},
		}
	}
</script>

<style scoped>
	
	.card-list-wrapper {
		width: 710upx;
		height: 100upx;
		margin: 0 auto;
	}

	.card-list-row {
		padding: 20upx;
	}

	.card-list-row-1 {
		padding: 10upx 0;
	}
	.card-label{
		display: inline-block;
		width: 150upx;
	}
	.top-border{
		border-top: 1upx solid rgba(0,0,0,.1);
	}
	.top-wrap{
		padding-bottom: 20upx;
		margin-bottom: 20upx;
	}
	.bottom-border{
		border-bottom: 1upx solid rgba(0,0,0,.1);
	}
	.btn-wrap{
		padding-top: 20upx;
	}
</style>
